package com.welkom.everydate.util.web;

import java.io.Serializable;

import com.welkom.everydate.common.Constants;

public class Operation implements Serializable {
	private String operationName;
	private String buttonClass;
	private int operationType;
	private String jsFunctionName;
	private String modalId;
	private String altText;
	public Operation() {
		
	}
	public Operation(String operationName, String buttonClass,
			int operationType, String jsFunctionName, String modalId) {
		this.operationName = operationName;
		this.buttonClass = buttonClass;
		this.operationType = operationType;
		this.jsFunctionName = jsFunctionName;
		this.modalId = modalId;
	}
	/**
	 * @return the operationName
	 */
	public String getOperationName() {
		return operationName;
	}
	/**
	 * @param operationName the operationName to set
	 */
	public void setOperationName(String operationName) {
		this.operationName = operationName;
	}
	/**
	 * @return the buttonClass
	 */
	public String getButtonClass() {
		return buttonClass;
	}
	/**
	 * @param buttonClass the buttonClass to set
	 */
	public void setButtonClass(String buttonClass) {
		this.buttonClass = buttonClass;
	}
	/**
	 * @return the operationType
	 */
	public int getOperationType() {
		return operationType;
	}
	/**
	 * @param operationType the operationType to set
	 */
	public void setOperationType(int operationType) {
		this.operationType = operationType;
	}
	/**
	 * @return the jsFunctionName
	 */
	public String getJsFunctionName() {
		return jsFunctionName;
	}
	/**
	 * @param jsFunctionName the jsFunctionName to set
	 */
	public void setJsFunctionName(String jsFunctionName) {
		this.jsFunctionName = jsFunctionName;
	}
	/**
	 * @return the modalId
	 */
	public String getModalId() {
		return modalId;
	}
	/**
	 * @param modalId the modalId to set
	 */
	public void setModalId(String modalId) {
		this.modalId = modalId;
	}
	
	
	public static Operation newViewOperationInstance(String jsFunctionName,String modalId){
		Operation operation=new Operation();
		operation.setButtonClass(Constants.OperationButtonStyle.OPERATION_CLASS_VIEW);
		operation.setJsFunctionName(jsFunctionName);
		operation.setModalId(modalId);
		operation.setOperationName(Constants.OperationName.OPERATION_NAME_VIEW);
		operation.setOperationType(Constants.OperationType.OPERATION_TYPE_VIEW);
		operation.setAltText(Constants.OperationAltText.OPERATION_ALT_TEXT_VIEW);
		return operation;
	}
	
	public static Operation newUpdateOperationInstance(String jsFunctionName,String modalId){
		Operation operation=new Operation();
		operation.setButtonClass(Constants.OperationButtonStyle.OPERATION_CLASS_UPDATE);
		operation.setJsFunctionName(jsFunctionName);
		operation.setModalId(modalId);
		operation.setOperationName(Constants.OperationName.OPERATION_NAME_UPDATE);
		operation.setOperationType(Constants.OperationType.OPERATION_TYPE_UPDATE);
		operation.setAltText(Constants.OperationAltText.OPERATION_ALT_TEXT_UPDATE);
		return operation;
	}
	
	public static Operation newDeleteOperationInstance(String jsFunctionName,String modalId){
		Operation operation=new Operation();
		operation.setButtonClass(Constants.OperationButtonStyle.OPERATION_CLASS_DELETE);
		operation.setJsFunctionName(jsFunctionName);
		operation.setModalId(modalId);
		operation.setOperationName(Constants.OperationName.OPERATION_NAME_DELETE);
		operation.setOperationType(Constants.OperationType.OPERATION_TYPE_DELETE);
		operation.setAltText(Constants.OperationAltText.OPERATION_ALT_TEXT_DELETE);
		return operation;
	}
	
	public static Operation newViewListOperationInstance(String jsFunctionName,String modalId){
		Operation operation=new Operation();
		operation.setButtonClass(Constants.OperationButtonStyle.OPERATION_CLASS_LIST);
		operation.setJsFunctionName(jsFunctionName);
		operation.setModalId(modalId);
		operation.setOperationName(Constants.OperationName.OPERATION_NAME_VIEW_SUB_LIST);
		operation.setOperationType(Constants.OperationType.OPERATION_SUB_LIST);
		operation.setAltText(Constants.OperationAltText.OPERATION_ALT_TEXT_SUB_LIST);
		return operation;
	}
	/**
	 * @return the altText
	 */
	public String getAltText() {
		return altText;
	}
	/**
	 * @param altText the altText to set
	 */
	public void setAltText(String altText) {
		this.altText = altText;
	}
	
	
}
